<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function curryIt(fn) {
      return function (a) {
        console.log(a);
        return function (b) {
          console.log(a,b);
          return function (c) {
            console.log(a,b,c);
            console.log(this);
            return fn(a, b, c)
          }
        }
      }
    }
    var fn = function (a, b, c) { return a + b + c }; 
    console.log(curryIt(fn)(1)(2)(3));
  </script>
</body>

</html>